
***************************************************************
************************File Description***********************
***************************************************************
*Replication data for "Customary Courts, State Institutions, or Opting Out: Patterns of Forum Pluralism in Three African Countries," World Development, 2025
*Authors: Funjika and Honig
*Dispute and Household models*              
*Note: These analyses use publically available dataset: Data source: Lust, E. et al (2019), `Program on Governance and Local Development, University of Gothenburg. 2019. The Local Governance and Performance Index (LGPI) 2019: Kenya, Malawi, Zambia'. http://www.gld.gu.se


clear
clear matrix
clear mata
set maxvar 10000

use "Replication Data.dta"

 
******************************************************************************
*FIGURES BASED ON DISPUTE SAMPLE
*********************************************************************************

set scheme white_tableau
*Figure 1 - Type of actor turned to for dispute resolution, by LGPI Sample 

graph bar prop_actor_customaryF prop_actor_stateF prop_actor_othercommF prop_actor_Nobody, over (LGPIsample_rec)  legend(order(1 "Customary Forum" 2 "State Forum" 3 "Other Community Forum" 4 "Nobody") position(6) rows(1) symxsize(*0.5))

graph export "Actor_fig3.pdf", replace

*Figure 2 - Village-level Forum Shopping Index
hist H_index_V if low_CR!=1 & smallsample !=1, ytitle("Density", size(medium)) xtitle("")		
graph export "h_index_new.pdf", replace


*Figure 8 - Type of actor turned to, by Dispute Type
graph bar prop_actor2_customaryF prop_actor2_stateF prop_actor2_othercommF prop_actor2_Nobody , over (category) legend(position(6)) legend(order(1 "Customary Forum" 2 "State Forum" 3 "Other Community Forum" 4 "Nobody") position(6) rows(1) symxsize(*0.5))

graph export "Actor_dispute.pdf", replace

 
 
*------------------------------------------------------------------------------
*SUMMARY STATISTICS TABLES BASED ON FULL SAMPLE
*------------------------------------------------------------------------------

*Table B1: Full Sample versus Dispute Sample Summary statistics
*restrict samples to individuals, not disputes 

tabout gender CtrlAge migrant10 native  maj_eth chiefrelated education marital admin_distance capital_distance highinc ctry group if additional_obs==0 ///
using tablea2.txt, replace cells(freq col) style(tex) f(0c 1) 


*Table B2: Balance Table of Means: Non-Dispute Sample versus Dispute Sample
balancetable group gender CtrlAge migrant10 native maj_eth chiefrelated education marital admin_distance capital_distance highinc using "balancetable.tex" if additional_obs==0 , pvalues starlevels(* 0.1 ** 0.05 *** 0.01) replace


*-----------------------------------------
*SUMMARY STATISTICS TABLES BASED ON DISPUTE SAMPLE
*-----------------------------------------
*Table B3. Dispute Sample Summary Statistics by Country
tabout Male  CtrlAge migrant10 native  maj_eth chiefrelated education marital a_cap_time village_n_dist highinc ctry if Dispute==1 ///
using tablea2.txt, replace cells(freq col) style(tex) f(0c 1)  

*Table B4 - Sample Summary Statistics by Type of Dispute and Household Attributes
tabout Male  CtrlAge migrant10 native  maj_eth chiefrelated education marital a_cap_time village_n_dist highinc ctry category if Dispute==1 ///
using tablea2.txt, replace cells(freq row) style(tex) f(0c 1)  //all countries combined

*Table B5 - Type of Actor Turned to for Dispute Resolution (individual characteristics)
tabout Male  CtrlAge migrant10  native  maj_eth chiefrelated education marital a_cap_time village_n_dist highinc category LGPIsample2 ctry Actor_cats3 if Dispute==1 using table3a.txt, replace cells(freq row) style(tex) f(0c 1)   



****************
*Main Village-Level Findings 
*****************

***drop all of the individual level variables to make it a village-level dataset

* Keep only variables used in the analyses
keep ///
    /* Dependent variables */ ///
    sqkm s_Nobody  share_state share_customary ///
    high_disputes_10 high_disputes ///
    /* Main independent variables */ ///
    H_index_V  FSI_3choices ///
    ///
    /* Control variables */ ///
    std_A_dist std_village_n_dist prop_migrant prop_migrant10 ELF ///
    sqkm_sample sqkm_totaldisputes sqkm_totaldisputes_2 ///
    reported_comm ///
    ///
    /* Sample restriction variables */ ///
    low_CR smallsample fewdisputes  ///
    ///
    /* Fixed effects and grouping variables */ ///
    LGPIsample_rec sample_purban ctry DistProv2  ///
  
**then remove duplicates
duplicates drop


*****************
*Table 1: Association Between FPI and Opting Out of Dispute Resolution
*****************
*Column 1 - pooled model
reg s_Nobody H_index_V std_A_dist std_village_n_dist prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if smallsample!=1 , cluster(DistProv2) 
estimates store Table1b

margins, at(H_index_V=(0(0.2)1)) post
estimates store model1

* Column 2 - pooled model but with fixed effects based on peri-urban sample status
reg s_Nobody H_index_V std_A_dist std_village_n_dist  prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.sample_purban i.ctry b3.ctry if smallsample!=1, cluster(DistProv2) 
estimates store Table2b

*Column 3 - Zambia 
reg s_Nobody H_index_V std_A_dist std_village_n_dist prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if ctry==3 & smallsample!=1 , cluster(DistProv2) 
estimates store Table3b


*Column 4 - Malawi 
reg s_Nobody H_index_V std_A_dist std_village_n_dist prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if ctry==2 & smallsample!=1 , cluster(DistProv2) 
estimates store Table4b

*Column 5 - Restricted analysis 

reg s_Nobody H_index_V std_A_dist std_village_n_dist prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if low_CR!=1 & smallsample!=1, cluster(DistProv2) 
estimates store Table5b

*Table 1 Presentation: Correlates of Opting Out of Dispute Resolution
estout  Table1b Table2b Table3b Table4b Table5b,  style(tex)  cells(b(star fmt(3)) se(par fmt(2))) stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared)) starlevels(* 0.10 ** 0.05 *** 0.01) title(Association Between FPI and Opting Out of Dispute Resolution) ///
	collabels("Pooled" "Pooled(alt)"  "Zambia" "Malawi" "Restricted") /*hides labels of columns*/ ///
	posthead(\hline\\) ///
	varlabels(_cons Constant) /*modify label of constant*/ ///     
	prefoot(\\\hline) ///
	label  /*make use of variable labels*/ ///
	eqlabels(" " " ") nobaselevels interaction(" $\times$ ")   /*remove the separate interaction labels*/


*****************
*Figure 4 :  Forum Pluralism and the Share Opting-Out of Dispute Resolution
*****************
	
*** part a	
coefplot (model1, mcolor(black) label(Pooled)), bylabel(Pooled Model)  ytitle("Predicted probability of opting out") xtitle(Forum Pluralism Index) at recast(line) ciopts(recast(rarea) lpattern(dash) color(%20)) level(90)
graph save "Graph" "sample_FPI.gph", replace 
	

****************
*Table D1: Correlates of the Forum Pluralism Index
*****************


*Column 1 - pooled model
reg  H_index_V std_A_dist std_village_n_dist prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if low_CR!=1 & smallsample !=1, cluster(DistProv2) 
estimates store Table1a

*Column 2 - pooled model but with fixed effects based on peri-urban sample status
reg H_index_V std_A_dist std_village_n_dist  prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.sample_purban i.ctry b3.ctry if low_CR!=1 & smallsample !=1, cluster(DistProv2) 
estimates store Table2a

*Column 3 - Zambia

reg H_index_V std_A_dist std_village_n_dist prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if ctry==3 & low_CR!=1 & smallsample !=1, cluster(DistProv2) 
estimates store Table3a

*Column 4 - Malawi 

reg  H_index_V std_A_dist std_village_n_dist  prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if ctry==2 & low_CR!=1 & smallsample !=1, cluster(DistProv2) 
estimates store Table4a

*Column 5 - Unrestricted (no restriction on disputes) 

reg  H_index_V std_A_dist std_village_n_dist  prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if low_CR!=1, cluster(DistProv2) 
estimates store Table5a

*Column 5 - Unrestricted (no restriction on village sample size or disputes) 

reg  H_index_V std_A_dist std_village_n_dist  prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec, cluster(DistProv2) 
estimates store Table6a

*Table D1 Presentation: Correlates of the Forum Pluralism Index 
estout  Table1a Table2a Table3a Table4a Table5a Table6a , style(tex)  cells(b(star fmt(3)) se(par fmt(2))) ///
stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared)) ///
starlevels(* 0.10 ** 0.05 *** 0.01) title(Correlates of the Forum Pluralism Index) ///
	collabels("Pooled" "Pooled (alt)"  "Zambia" "Malawi" "Unrestricted (a)" "Unrestricted(b)") /*hides labels of columns*/ ///
	posthead(\hline\\) ///
	varlabels(_cons Constant) /*modify label of constant*/ ///     
	prefoot(\\\hline) ///
	label  /*make use of variable labels*/ ///
	eqlabels(" " " ") nobaselevels interaction(" $\times$ ")   /*remove the separate interaction labels*/
	
****************************
*Figure 3 (Model 1): Village-level Correlates of the Forum Pluralism Index
******************************
coefplot (Table1a, mcolor (black)  ciopts(lcolor(black)) label(Pooled)), bylabel(Pooled) || , drop(_cons DistProv2 LGPIsample_rec sqkm_sample sqkm_totaldisputes) xline(0, lcolor(black) lwidth(thin) lpattern(dash)) ///
 levels(95) msymbol(o) ///
xtitle({bf:Correlates of the Forum Pluralism Index}, size(medium)) legend(off) xscale(range(-0.5 1.0)) ///
xlabel(-0.5(.5)1.0) graphregion(color(white)) grid(between glcolor(white)) ///
legend(label(1 "") row(1)  size (small)) ylab(, labs(2.5)) xlab(, labs(2.5)) ysize(6.5)

graph export "Correlates_D1.pdf", replace

*******************
*Table D2 -Correlates of  Dispute Prevalence
**********************
*Column 1 - pooled model
reg high_disputes_10  H_index_V  reported_comm prop_migrant10 std_A_dist std_village_n_dist  i.LGPIsample_rec if smallsample!=1, cluster(DistProv2)
estimates store Table1c

*Column 2 - pooled model but with fixed effects based on peri-urban sample status
reg high_disputes_10  H_index_V  reported_comm prop_migrant10  std_A_dist std_village_n_dist  i.sample_purban i.ctry b3.ctry if smallsample!=1, cluster(DistProv2)
estimates store Table2c

*Column 3 - Zambia
reg high_disputes_10  H_index_V  reported_comm prop_migrant10  std_A_dist std_village_n_dist i.LGPIsample_rec if ctry==3 & smallsample!=1, cluster(DistProv2)
estimates store Table3c

*Column 4 - Malawi
reg high_disputes_10  H_index_V  reported_comm prop_migrant10 std_A_dist std_village_n_dist  i.LGPIsample_rec if ctry==2 & smallsample!=1, cluster(DistProv2)  
estimates store Table4c

*Column 5 - restricted model
reg high_disputes_10  H_index_V  reported_comm prop_migrant10  std_A_dist std_village_n_dist i.LGPIsample_rec if low_CR!=1 & smallsample!=1, cluster(DistProv2)
estimates store Table5c

*Column 6 - No H_index_v
******Any model with H_index in it will drop villages with 0 disputes, so this one removes it 
reg high_disputes_10  reported_comm prop_migrant10  std_A_dist std_village_n_dist i.LGPIsample_rec if smallsample!=1, cluster(DistProv2)
estimates store Table6c

*Table D2: Correlates of  Disputes Prevalence
estout  Table1c Table2c Table3c Table4c Table5c Table6c, style(tex)  cells(b(star fmt(3)) se(par fmt(2))) stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared)) starlevels(* 0.10 ** 0.05 *** 0.01)

estout Table1c Table2c Table3c Table4c Table5c Table6c, replace style(tex) ///
    prehead("\footnotesize" "\setlength{\tabcolsep}{4pt}" "\begin{longtable}{*{10}{l}}" ///
            "\caption{Village-Level Correlates of Dispute Prevalence \label{tab:dispute_prev}} \\" ///
            "\hline \hline" ///
            "Dependent Variable  & \multicolumn{6}{c}{Disputes per Sample} \\ \hline" ///
            "                    &Pooled &Pooled (alt)     & Zambia &Malawi & Restricted & Omit FPI \\") ///
    title("") ///
    eqlabels(none) ///
    mlabels(none) ///
    collabels(none) ///
    posthead(\hline) ///
    cells(b(star fmt(%9.3f)) se(par fmt(%9.2f))) ///
    varlabels(_cons Constant) ///
    prefoot(\\\hline) ///
    stats(r2 N, fmt(%9.3f %9.0f) labels("R-squared" "N")) ///
    postfoot("\\\hline\hline" ///
            "\multicolumn{10}{p{0.9\textwidth}}{\footnotesize Significance levels * 10\% ** 5\% *** 1\%. Notes: The table presents the correlates of locality level measures of dispute prevalence and village characteristics. Reported CA is omitted due to collinearity in the Malawi and restricted models (all communities have CAs). Model 6 omits FPI to include villages which had no disputes. $^\phi$ base for the Malawi based regression is the Malawi Border. Standard errors clustered at the Province (Kenya/Zambia) or District level (Malawi).} \\" ///
            "\end{longtable}" ///
            "\normalsize") ///
    nolegend ///
    label ///
    nobaselevels interaction(" $\times$ ") starlevels(* 0.10 ** 0.05 *** 0.01)

*Figure 4 - Pooled Model only: Village-level Correlates of Dispute Prevalence
coefplot (Table1c, mcolor (black)  ciopts(lcolor(black)) label(Pooled Model)), bylabel(Pooled) || , drop(_cons) xline(0, lcolor(black) lwidth(thin) lpattern(dash)) levels(95) msymbol(o) xtitle({bf:Correlates of Disputes Prevalence}, size(small)) legend(off) xscale(range(-0.5 1.0)) ///
xlabel(-0.5(.5)1.0) graphregion(color(white)) grid(between glcolor(white)) ///
legend(label(1 "") row(1)  size (small)) ylab(, labs(2.5)) xlab(, labs(2.5)) ysize(6.5)

graph export "Correlates_D2.pdf", replace


*******************
*Table D3 - Correlates of Opting Out of Dispute Resolution - alternative FPI
*******************
reg s_Nobody FSI_3choices std_A_dist std_village_n_dist prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if smallsample!=1 , cluster(DistProv2)
estimates store Table1d

reg s_Nobody FSI_3choices  std_A_dist std_village_n_dist  prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.sample_purban i.ctry b3.ctry if smallsample!=1, cluster(DistProv2) 
estimates store Table2d

reg s_Nobody FSI_3choices std_A_dist std_village_n_dist prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if ctry==3 & smallsample!=1 , cluster(DistProv2) 
estimates store Table3d

reg s_Nobody FSI_3choices std_A_dist std_village_n_dist prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if ctry==2 & smallsample!=1 , cluster(DistProv2) 
estimates store Table4d

reg s_Nobody FSI_3choices std_A_dist std_village_n_dist prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if low_CR!=1 & smallsample!=1, cluster(DistProv2)
estimates store Table5d

*Table B3 Presentation: Correlates of  Opting Out of Dispute Resolution - Alternative FPI
estout  Table1d Table2d Table3d Table4d Table5d, style(tex)  cells(b(star fmt(3)) se(par fmt(2))) stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared)) starlevels(* 0.10 ** 0.05 *** 0.01) title(Correlates of  Opting Out of Dispute Resolution - Alternative FPI) ///
	collabels("Pooled" "Pooled(alt)"  "Zambia" "Malawi" "Restricted") /*hides labels of columns*/ ///
	posthead(\hline\\) ///
	varlabels(_cons Constant) /*modify label of constant*/ ///     
	prefoot(\\\hline) ///
	label  /*make use of variable labels*/ ///
	eqlabels(" " " ") nobaselevels interaction(" $\times$ ") 

*************************************************************************************
*SPLIT SAMPLE MODELS - DISTRICT LEVEL
********************************************************************** 
clear
clear matrix
clear mata
set maxvar 10000
use "districtlevel_splitsample.dta"

 *clustered at province level
 reg S_Nobody_q5_split H_index_split  geog_q5_totaldisputes, cluster (LGPIsample_rec)   
 estimates store Model1
 margins, at(H_index_split=(0(0.2)1)) post
 estimates store margins1
 

 *restricted to districts where we have at least 10 observations 
 reg S_Nobody_q5_split H_index_split  geog_q5_totaldisputes i.LGPIsample_rec if geo5_sample >=10, cluster (LGPIsample_rec) 
 estimates store Model2
  
 *Unrestricted model - no restrictions
 reg S_Nobody_q5_split H_index_split  geog_q5_totaldisputes i.LGPIsample_rec, cluster (LGPIsample_rec) 
 estimates store Model3
 
*Table D4: Correlates of Opting Out - Split Sample Mode
estout  Model1 Model2 Model3, style(tex)  cells(b(star fmt(3)) se(par fmt(2))) stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared)) ///
    starlevels(* 0.10 ** 0.05 *** 0.01) title(Correlates of Village Level Customary Forum Choice) ///
	collabels("Base" "Restricted"  "Unrestricted" ) /*hides labels of columns*/ ///
	posthead(\hline\\) ///
	varlabels(_cons Constant H_index_split FPI) /*modify label of constant*/ ///     
	prefoot(\\\hline) ///
	label  /*make use of variable labels*/ ///
	eqlabels(" " " ") nobaselevels interaction(" $\times$ ") 

*Figure 4: Forum Pluralism and the Share Opting-Out of Dispute Resolution (part b)
coefplot (margins1, mcolor(black) ciopts(recast(rarea) color(gs10) color(%20)) label(Base Model)), bylabel(Base Model) xtitle(Forum Pluralism Index) at recast(line) level(90) 
 graph save "Graph" "Split_FPI.gph", replace 

*Figure 4: Forum Pluralism and the Share Opting-Out of Dispute Resolution (part b)
graph combine "sample_FPI.gph" "Split_FPI.gph", subtitle("Pooled Model vs. Split Sample") 

		

*------------------------------------------------------------------------------
*Models of Household Dispute Likelihood
*------------------------------------------------------------------------------
***use full dataset***
clear
use "Replication Data.dta"

***Table D5: Correlates of Dispute Reporting on Survey 
**all disputes

melogit HH_dispute chiefrelated migrant10  maj_eth std_Age education_recode insecurity Married##Male std_A_dist  std_village_n_dist reported_comm ///
prop_migrant ELF if additional_obs==0 /// 
  || LGPIsample2: || sqkm: 
 
 estimates store H1, title (Any Dispute) 
  
**crime disputes*********
 
 melogit HH_crime chiefrelated migrant10  maj_eth std_Age education_recode insecurity Married##Male std_A_dist  std_village_n_dist reported_comm   ///
prop_migrant ELF if additional_obs==0  /// 
  || LGPIsample2: || sqkm: 
   
 estimates store H2, title (Crimes)
  
**non crime disputes***
  melogit HH_noncrime  chiefrelated migrant10  maj_eth std_Age education_recode insecurity Married##Male std_A_dist  std_village_n_dist reported_comm  ///
prop_migrant ELF  if additional_obs==0 /// 
  || LGPIsample2: || sqkm: 

 estimates store H3, title (Non-Crimes)  
  
***table D5


estout H1 H2 H3,/*displays models 1-3*/ ///
	 replace style(tex) ///
	title(Correlates of Dispute Reporting) ///
	collabels("All Disputes"  "Crimes" "Non-Crimes") /*hides labels of columns*/ ///
	posthead(\hline\\) ///
	cells(b(star fmt(%9.3f)) se(par)) /*displays coefs with 1 decimal*/ ///
			varlabels(_cons Constant /*modify label of constant*/ ///
			          "var(_cons[LGPIsample2])" "var(Sample)" ///
              "var(_cons[LGPIsample2>sqkm])" "var(Village)") ///
	drop (_cons) ///
	prefoot(\\\hline) ///
	stats(chi2 N, fmt(%9.2f %9.0f g) labels(chi2)) ///
	nolegend /*hides significance symbols legend */ ///
	label  /*make use of variable labels*/ ///
	eqlabels(" " " ") ///
	nobaselevels interaction(" $\times$ ")   starlevels(* 0.10 ** 0.05 *** 0.01) /*remove the separate interaction labels*/
	


**Figure 6: Correlates of Reporting a Dispute

 
coefplot (H1, label (All Disputes)  color(red) msymbol(O) ciopts(color(red) msymbol(O))) (H2, label (Crime Only) color (blue)  msymbol(T) ciopts(color(blue))) (H3, label (Non-Crime Only) color (green)   msymbol(D) ciopts(color(green))), keep(*.Married#*.Male chiefrelated migrant10  maj_eth std_Age education_recode insecurity std_A_dist ) xline(0, lcolor(black) lwidth(thin) lpattern(dash)) ///
levels(95) msymbol(o) ///
coeflabels(*.Married#*.Male = "Married x Male") ///
xtitle({bf:Coefficients Predicting Reporting Dispute}, size(small)) 

graph export Dispute_Report.pdf, replace
 


*------------------------------------------------------------------------------
*Models of Forum Choice
*------------------------------------------------------------------------------
**Three level model with responses clustered at the Sample, household (SbjNum) and village (Sqkm) 
***0 is nobody
***1 is state
**2 is customary
***3 is other community (decreasing levels of formality)


**Table D6: Correlates of Forum Choice, all Disputes

***M1 Main model, all disputes

gsem (nobody_base <- chiefrelated migrant10   maj_eth  std_Age  education_recode insecurity  Married##Male reported_comm b2.category std_a_cap_time std_village_n_dist ///
prop_migrant ELF    ///
, mlogit ) group (LGPIsample2 sqkm SbjNum),  nocapslatent 

estimates store m1


***M2: all disputes, restricted to places with chiefs

gsem (nobody_base <- chiefrelated migrant10   maj_eth  std_Age  education_recode insecurity  Married##Male reported_comm b2.category std_a_cap_time std_village_n_dist ///
prop_migrant ELF    ///
, mlogit ) group (LGPIsample2 sqkm SbjNum) if reported_comm==1, nocapslatent

estimates store m2


***Table 6 with full models
estout m1 m2, unstack drop(0b.nobody_base:* _cons) replace style(tex) ///
    prehead("\footnotesize" "\setlength{\tabcolsep}{4pt}" "\begin{longtable}{lllllll}" ///
            "\caption{Correlates of Forum Choice, All Disputes \label{tab:forum choice}} \\" ///
            "\hline \hline" ///
            "                    & \multicolumn{3}{c}{Model 1} & \multicolumn{3}{c}{Model 2} \\ \hline" ///
            "Dependent Variable  &       State   &   Customary   & Other Comm.   &       State   &   Customary   & Other Comm.   \\") ///
    title("") ///
    mlabels(none) ///
    eqlabels(none) ///
    collabels(none) ///
    posthead(\hline) ///
    cells(b(star fmt(%9.3f)) se(par)) ///
    varlabels(_cons Constant) ///
    prefoot(\\\hline) ///
    stats(N, fmt(%9.0f) ///
          labels("N")) ///
postfoot("\\\hline\hline" ///
            "\multicolumn{7}{p{0.9\textwidth}}{\footnotesize Significance levels * 10\% ** 5\% *** 1\%. Notes:	The table presents " ///
   " the results of multi-level multinomial logistic regression models with random effects" ///
   " nested at the Sample, Village, and Household levels. Base outcome is not seeking help for a reported dispute.} \\" ///
            "\end{longtable}" ///
            "\normalsize") ///
    nolegend ///
    label ///
    nobaselevels interaction(" $\times$ ") starlevels(* 0.10 ** 0.05 *** 0.01)


***Table D7 separates criminal and non criminal 
**criminal only
gsem (nobody_base <- chiefrelated migrant10   maj_eth  std_Age  education_recode insecurity  Married##Male reported_comm  std_a_cap_time std_village_n_dist ///
prop_migrant ELF    ///
, mlogit ) group (LGPIsample2 sqkm SbjNum) if category ==0,  nocapslatent 

estimates store m3

**non criminal disputes
gsem (nobody_base <- chiefrelated migrant10   maj_eth  std_Age  education_recode insecurity  Married##Male reported_comm  std_a_cap_time std_village_n_dist ///
prop_migrant ELF    ///
, mlogit ) group (LGPIsample2 sqkm SbjNum) if category !=0,  nocapslatent 

estimates store m4
	
	
**Table D7*****
	estout m3 m4, unstack drop(0b.nobody_base:* _cons) replace style(tex) ///
    prehead("\footnotesize" "\setlength{\tabcolsep}{4pt}" "\begin{longtable}{lllllll}" ///
          "\caption{Correlates of Forum Choice, by Crimes and Non-Crimes \label{tab:crimes_forum choice}} \\" ///
            "\hline \hline" ///
            "                    & \multicolumn{3}{c}{Crimes} & \multicolumn{3}{c}{Non-Crimes} \\ \hline" ///
            "Dependent Variable  &       State   &   Customary   & Other Comm.   &       State   &   Customary   & Other Comm.   \\") ///
    title("") ///
    mlabels(none) ///
    eqlabels(none) ///
    collabels(none) ///
    posthead(\hline) ///
    cells(b(star fmt(%9.3f)) se(par)) ///
    varlabels(_cons Constant) ///
    prefoot(\\\hline) ///
    stats(N, fmt(%9.0f) ///
          labels("N")) ///
postfoot("\\\hline\hline" ///
            "\multicolumn{7}{p{0.9\textwidth}}{\footnotesize Significance levels * 10\% ** 5\% *** 1\%. Notes:	The table presents " ///
   " the results of multi-level multinomial logistic regression models with random effects" ///
   " nested at the Sample, Village, and Household levels. Base outcome is not seeking help for a reported dispute.} \\" ///
            "\end{longtable}" ///
            "\normalsize") ///
    nolegend ///
    label ///
    nobaselevels interaction(" $\times$ ") starlevels(* 0.10 ** 0.05 *** 0.01)


	
*****Figure 7: Status, Access, and Forum Choice Results			

coefplot (m1, label("All Disputes (M1)") color(red) msymbol(O) ciopts(color(red))) ///
        (m3, label("Crimes") color(blue) msymbol(T) ciopts(color(blue))) ///
        (m4, label("Non-Crimes") color(green) msymbol(D) ciopts(color(green))), ///
   keep(1.nobody_base:chiefrelated 1.nobody_base:migrant10 1.nobody_base:education_recode ///
        1.nobody_base:insecurity 1.nobody_base:maj_eth 1.nobody_base:*category 1.nobody_base:std_a_cap_time 1.nobody_base:std_village_n_dist ///
        2.nobody_base:chiefrelated 2.nobody_base:migrant10 2.nobody_base:education_recode 2.nobody_base:std_a_cap_time  2.nobody_base:std_village_n_dist ///
        2.nobody_base:insecurity 2.nobody_base:maj_eth 2.nobody_base:*category) ///
   xline(0, lcolor(black) lwidth(thin) lpattern(dash)) ///
   levels(95) ///
   xtitle("{bf:Coefficients Predicting Use of State and Customary Forums}", size(small)) ///
   xscale(range(-0.5 0.5)) ///
   bylabel(1 "{bf:State}" 2 "{bf:Customary}") ///
   eqlabels("{bf:State}" "{bf:Customary}") ///
   subtitle("")
   

graph export "Forum Choice.pdf", replace
 	
	

*------------------------------------------------------------------------------
*Opting-Out Models
*------------------------------------------------------------------------------
**Table D9 Correlates of Forum Use

**all disputes
melogit Somebody_D chiefrelated migrant10   maj_eth  std_Age  education_recode insecurity  Married Male reported_comm b2.category std_a_cap_time std_village_n_dist ///
prop_migrant ELF  || LGPIsample2: || sqkm: || SbjNum:

estimates store a1 

***crimes only

melogit Somebody_D chiefrelated migrant10   maj_eth  std_Age  education_recode insecurity  Married Male reported_comm std_a_cap_time std_village_n_dist ///
prop_migrant ELF if category ==0  || LGPIsample2: || sqkm: || SbjNum:

estimates store a2 
** non crimes only 

melogit Somebody_D chiefrelated migrant10   maj_eth  std_Age  education_recode insecurity  Married Male reported_comm  std_a_cap_time std_village_n_dist ///
prop_migrant ELF if category !=0  || LGPIsample2: || sqkm: || SbjNum:

estimates store a3 

****all disputes, separating out marital status

melogit Somebody_D chiefrelated migrant10   maj_eth  std_Age  education_recode insecurity  i.Mar_gen reported_comm b2.category std_a_cap_time std_village_n_dist ///
prop_migrant ELF  || LGPIsample2: || sqkm: || SbjNum:
estimates store a4 

****all disputes, adding FPI 
***restricted to 10 subjects, but no dispute restriction 
melogit Somebody_D chiefrelated migrant10   maj_eth  std_Age  education_recode insecurity  Married Male reported_comm b2.category std_a_cap_time std_village_n_dist ///
 H_index_V sqkm_sample  sqkm_totaldisputes ///
prop_migrant ELF if sqkm_sample >=10  || LGPIsample2: ||  sqkm: || SbjNum:
	estimates store a5
	
***all disputes, restricted to communities where 5 respondents used a forum and sample had 10 subjects 
melogit Somebody_D chiefrelated migrant10   maj_eth  std_Age  education_recode insecurity  Married Male reported_comm b2.category std_a_cap_time std_village_n_dist ///
 H_index_V sqkm_sample  sqkm_totaldisputes ///
prop_migrant ELF if low_CR!=1 & sqkm_sample >=10   || LGPIsample2: ||  sqkm: || SbjNum:
estimates store a6


****appendix table D9

estout a1 a2 a3 a4 a5 a6, replace style(tex) ///
    prehead("\footnotesize" "\setlength{\tabcolsep}{3pt}" "\begin{longtable}{lllllll}" ///
            "\caption{Correlates of Forum Use \label{tab:forum_use}} \\" ///
            "\hline \hline" ///
            "Dependent Variable & \multicolumn{6}{c}{Forum Use} \\" ///
            "Sample & All Disputes & Crimes & Non-Crimes & All Disputes & All Disputes & All Disputes (Restricted Villages) \\" ///
            "\cline{2-7}") ///
    title("") ///
    mlabels(none) ///
    posthead(\hline\\) ///
    cells(b(star fmt(%9.3f)) se(par)) ///
    varlabels(_cons Constant ///
        "var(_cons[LGPIsample2])" "var(Sample)" ///
        "var(_cons[LGPIsample2>sqkm])" "var(Village)" ///
        "var(_cons[LGPIsample2>sqkm>SbjNum])" "var(Household)") ///
    drop (maj_eth std_Age prop_migrant ELF) ///
    prefoot(\\\hline) ///
    stats(chi2 N, fmt(%9.2f %9.0f g) labels(chi2)) ///
    postfoot("\\\hline\hline" ///
            "\multicolumn{7}{p{0.9\textwidth}}{\footnotesize Significance levels * 10\% ** 5\% *** 1\%. Notes: ADD.} \\" ///
            "\end{longtable}" ///
            "\normalsize") ///
    nolegend ///
    label ///
    eqlabels(none) ///
    nobaselevels interaction(" $\times$ ") starlevels(* 0.10 ** 0.05 *** 0.01)
	

	
********************
*Appendix E 
*********************	

***dispute dataset***

clear
clear matrix
clear mata
set maxvar 10000

use "Replication Data.dta"
keep if Dispute==1

*Figure E1: Density Plots of Village FPI with varying number of disputes and sample size

//Scenario 1: No restrictions
hist H_index_V, density title(No restrictions)  ytitle("Density", size(medium)) xtitle("") name(graph1)

//Scenario 2: restriction - 5 respondents (10 in original) and 5 disputes (maintained) 
preserve
gen low_CR1=0
replace low_CR1=1 if  sqkm_totaldisputes_2<=5 
gen smallsample1=0
replace smallsample1=1 if  sqkm_sample<=5 
hist H_index_V if low_CR1!=1 & smallsample1 !=1, density title(5 respondents and 5 disputes) ytitle("Density", size(medium)) xtitle("") name(graph2)
restore

//Scenario 3: restriction - 5 respondents (10 in original), no limit on disputes (5 in original)
preserve
gen smallsample1=0
replace smallsample1=1 if  sqkm_sample<=5 
hist H_index_V if smallsample1 !=1  , density title(5 respondents and no limit on disputes) ytitle("Density", size(medium)) xtitle("") name(graph3)
restore

//Scenario 4: restriction - no limit on respondents (10 in original), 5 disputes (maintained)
preserve
gen low_CR1=0
replace low_CR1=1 if  sqkm_totaldisputes_2<=5 
hist H_index_V if low_CR1!=1, density title(no limit on respondents and 5 disputes) ytitle("Density", size(medium)) xtitle("") name(graph4)
restore

//Scenario 5: 15 respondents (increased from 10), 5 disputes (maintained) 
preserve
gen low_CR1=0
replace low_CR1=1 if  sqkm_totaldisputes_2<=5 
gen smallsample1=0
replace smallsample1=1 if  sqkm_sample<=15 
hist H_index_V  if low_CR1!=1 & smallsample1 !=1, density title(15 respondents and 5 disputes) ytitle("Density", size(medium)) xtitle("") name(graph5)
restore

//Scenario 6: 15 respondents (increased), no limit on disputes (increased)
preserve
gen smallsample1=0
replace smallsample1=1 if  sqkm_sample<=15 
hist H_index_V  if smallsample1 !=1,  density  title(15 respondents and no limit on disputes) ytitle("Density", size(medium)) xtitle("") name(graph6)
restore

//Scenario 7: 10 respondents (maintained), 2 disputes (reduced)
preserve
gen low_CR1=0
replace low_CR1=1 if  sqkm_totaldisputes_2<=2
gen smallsample1=0
replace smallsample1=1 if  sqkm_sample<=10 
hist H_index_V   if low_CR1!=1 & smallsample1 !=1, density  title(10 respondents and 2 disputes) ytitle("Density", size(medium)) xtitle("") name(graph8)
restore

//Scenario 8: 5 respondents (reduced), 2 disputes (reduced)
preserve
gen low_CR1=0
replace low_CR1=1 if  sqkm_totaldisputes_2<=2 
gen smallsample1=0
replace smallsample1=1 if  sqkm_sample<=5 
hist H_index_V   if low_CR1!=1 & smallsample1 !=1, density title(5 respondents and 2 disputes) ytitle("Density", size(medium)) xtitle("") name(graph9)
restore

//Scenario 9: restriction - no limit on respondents (increased), 2 disputes (reduced)
preserve
gen low_CR1=0
replace low_CR1=1 if  sqkm_totaldisputes_2<=2
hist H_index_V  if low_CR1!=1 , density title(no limit on respondents and 2 disputes) ytitle("Density", size(medium)) xtitle("") name(graph10)
restore


graph combine graph1 graph2 graph3 graph4 graph5 graph6 graph8 graph9 graph10, col(3) ///
    graphregion(margin(r=5))
	
	graph export "robust_check.pdf", replace

*****************
*Tables E1-2
******************

clear
clear matrix
clear mata
set maxvar 10000

use "Replication Data.dta"

***village level 	

***drop all of the individual level variables to make it a village-level dataset

* Keep only variables used in the analyses
keep ///
    /* Dependent variables */ ///
    sqkm s_Nobody  share_state share_customary ///
    high_disputes_10 high_disputes ///
    /* Main independent variables */ ///
    H_index_V  FSI_3choices ///
    ///
    /* Control variables */ ///
    std_A_dist std_village_n_dist prop_migrant prop_migrant10 ELF ///
    sqkm_sample sqkm_totaldisputes sqkm_totaldisputes_2 ///
    reported_comm ///
    ///
    /* Sample restriction variables */ ///
    low_CR smallsample fewdisputes  ///
    ///
    /* Fixed effects and grouping variables */ ///
    LGPIsample_rec sample_purban ctry DistProv2  ///
  
**then remove duplicates
duplicates drop


*****************************************************
 *Table E1: Naive and Unrestriced Models - Association Between FPI and Opting Out of Dispute Resolution
 *****************************************************
 *Column 1 - naive model
reg s_Nobody H_index_V if smallsample!=1 , cluster(DistProv2) 
estimates store Table1e

*Column 2 - Restricted Model  - Controls for disputes
reg s_Nobody H_index_V sqkm_totaldisputes if smallsample!=1 ,  cluster(DistProv2) 
estimates store Table2e

*Column 1 - Unrestricted Model  - Controls for disputes, no restriction on the number of villages included
reg s_Nobody H_index_V sqkm_totaldisputes, cluster(DistProv2) 
estimates store Table3e 
 
*Table E1 Presentation: Correlates of Opting Out of Dispute Resolution
estout  Table1e Table2e Table3e,  style(tex)  cells(b(star fmt(3)) se(par fmt(2))) stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared)) starlevels(* 0.10 ** 0.05 *** 0.01) title(Naive and Unrestricted Models - Association Between FPI and Opting Out of Dispute Resolution) ///
	collabels("Naive" "Restricted"  "Unrestricted") /*hides labels of columns*/ ///
	posthead(\hline\\) ///
	varlabels(_cons Constant H_index_V VillageFPI) /*modify label of constant*/ ///     
	prefoot(\\\hline) ///
	label  /*make use of variable labels*/ ///
	eqlabels(" " " ") nobaselevels interaction(" $\times$ ")   /*remove the separate interaction labels*/ 
 


*****************
*Table E2: Fractional Logistic Regression Predicting Probability of Opting Out of Dispute Resolution
******************

*Column 1 - pooled model
fracreg logit s_Nobody H_index_V std_A_dist std_village_n_dist prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if smallsample!=1, vce(cluster DistProv2) 
estimates store Table1a2

*Column 2 - pooled model but with fixed effects based on peri-urban sample status
fracreg logit s_Nobody H_index_V std_A_dist std_village_n_dist prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.sample_purban i.ctry b3.ctry if smallsample!=1, vce(cluster DistProv2) 
estimates store Table2a2

*Column 3 - Zambia
fracreg logit s_Nobody H_index_V std_A_dist std_village_n_dist prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if ctry==3 & smallsample!=1 , vce(cluster DistProv2) 
estimates store Table4a2

*Column 4 - Malawi
fracreg logit s_Nobody H_index_V std_A_dist std_village_n_dist prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if ctry==2 & smallsample!=1, vce(cluster DistProv2) 
estimates store Table3a2

*Column 5 - restricted model
fracreg logit  s_Nobody H_index_V std_A_dist std_village_n_dist prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if low_CR!=1 & smallsample!=1, vce (cluster DistProv2) 
estimates store Table5a2

*Table E2 Presentation: Fractional Logistic Regression Predicting  Probability of Share Opting Out of Dispute Resolution
estout  Table1a2 Table2a2 Table4a2 Table3a2 Table5a2, style(tex)  cells(b(star fmt(3)) se(par fmt(2))) stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared)) starlevels(* 0.10 ** 0.05 *** 0.01) title(Fractional Logistic Regression Predicting  Probability of Share Opting Out of Dispute Resolution) ///
	collabels("Pooled" "Pooled (alt)"  "Zambia" "Malawi" "Restricted") /*hides labels of columns*/ ///
	posthead(\hline\\) ///
	varlabels(_cons Constant) /*modify label of constant*/ ///     
	prefoot(\\\hline) ///
	label  /*make use of variable labels*/ ///
	eqlabels(" " " ") nobaselevels interaction(" $\times$ ") 

	

*****************
*Table E3: Correlates of Village Level State Forum Choice
******************
*Column 1 - pooled model 
reg share_state H_index_V std_A_dist std_village_n_dist  prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.sample_purban i.ctry b3.ctry  if fewdisputes !=1, cluster(DistProv2) 
estimates store Table11a1

*Column 2 - pooled model (no fixed effects)
reg share_state  H_index_V std_A_dist std_village_n_dist  prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if fewdisputes !=1, cluster(DistProv2) 
estimates store Table21a1

*Column 3 - Zambia
reg share_state  H_index_V std_A_dist std_village_n_dist  prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if ctry==3 & fewdisputes !=1, cluster(DistProv2) 
estimates store Table41a1

*Column 4 - Malawi
reg share_state  H_index_V std_A_dist std_village_n_dist  prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if ctry==2 & fewdisputes !=1, cluster(DistProv2) 
estimates store Table31a1


*Table E3 Presentation: Correlates of Village Level State Forum Choice
estout  Table11a1 Table21a1 Table41a1 Table31a1 , style(tex)  cells(b(star fmt(3)) se(par fmt(2))) stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared)) starlevels(* 0.10 ** 0.05 *** 0.01) title(Correlates of Village Level State Forum Choice) ///
	collabels("Pooled" "Pooled (alt)"  "Zambia" "Malawi" ) /*hides labels of columns*/ ///
	posthead(\hline\\) ///
	varlabels(_cons Constant) /*modify label of constant*/ ///     
	prefoot(\\\hline) ///
	label  /*make use of variable labels*/ ///
	eqlabels(" " " ") nobaselevels interaction(" $\times$ ") 



*****************
*Table E4: Correlates of Village-Level Customary Forum Choice
******************
*Column 1 - pooled model
reg share_customary H_index_V std_A_dist std_village_n_dist  prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.sample_purban i.ctry b3.ctry if fewdisputes !=1, cluster(DistProv2) 
estimates store Table11a2

*Column 2 - pooled model (no fixed effects)
reg share_customary  H_index_V std_A_dist std_village_n_dist  prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec  if fewdisputes !=1, cluster(DistProv2) 
estimates store Table21a2

*Column 3 - Zambia
reg share_customary H_index_V std_A_dist std_village_n_dist  prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if ctry==3 & fewdisputes !=1, cluster(DistProv2) 
estimates store Table41a2

*Column 4 - Malawi
reg share_customary  H_index_V std_A_dist std_village_n_dist  prop_migrant ELF sqkm_sample sqkm_totaldisputes high_disputes i.LGPIsample_rec if ctry==2 & fewdisputes !=1, cluster(DistProv2) 
estimates store Table31a2

*Table E4 Presentation: Correlates of Village Level Customary Forum Choice
estout  Table11a2 Table21a2 Table41a2 Table31a2 , style(tex)  cells(b(star fmt(3)) se(par fmt(2))) stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared)) starlevels(* 0.10 ** 0.05 *** 0.01)  title(Correlates of Village Level Customary Forum Choice) ///
	collabels("Pooled" "Pooled (alt)"  "Zambia" "Malawi" ) /*hides labels of columns*/ ///
	posthead(\hline\\) ///
	varlabels(_cons Constant) /*modify label of constant*/ ///     
	prefoot(\\\hline) ///
	label  /*make use of variable labels*/ ///
	eqlabels(" " " ") nobaselevels interaction(" $\times$ ") 
	
	
*****************
*Tables E5-8: Forum use by country and urban/rural subsamples
******************	

clear
clear matrix
clear mata
set maxvar 10000

use "Replication Data.dta"
	
**********Table E5 by country*********

***M1 Main model, all disputes

gsem (nobody_base <- chiefrelated migrant10   maj_eth  std_Age  education_recode insecurity  Married##Male reported_comm b2.category std_a_cap_time std_village_n_dist ///
prop_migrant ELF   ///
, mlogit ) group (LGPIsample2 sqkm SbjNum) if ctry ==3 ,  nocapslatent 

estimates store c1, title (Zambia)


gsem (nobody_base <- chiefrelated migrant10   maj_eth  std_Age  education_recode insecurity  Married##Male reported_comm b2.category std_a_cap_time std_village_n_dist ///
prop_migrant ELF   ///
, mlogit ) group (LGPIsample2 sqkm SbjNum) if ctry ==2 ,  nocapslatent 

estimates store c2, title (Malawi)

gsem (nobody_base <- chiefrelated migrant10   maj_eth  std_Age  education_recode insecurity  Married##Male reported_comm b2.category std_a_cap_time std_village_n_dist ///
prop_migrant ELF   ///
, mlogit ) group (LGPIsample2 sqkm SbjNum) if ctry ==1 ,  nocapslatent 

estimates store c3, title (Kenya)
		
**Table E5: 
				
estout c1, unstack drop(0b.nobody_base:* _cons) replace style(tex) ///
    prehead("\footnotesize" "\setlength{\tabcolsep}{4pt}" "\begin{longtable}{*{10}{l}}" ///
            "\caption{Correlates of Forum Choice in Zambia \label{tab:Zambia}} \\" ///
            "\hline \hline" ///
            "                    & \multicolumn{3}{c}{Zambia} \\ \hline" ///
            "Dependent Variable  &       State   &   Customary   & Other Comm.   \\") ///
    title("") ///
    eqlabels(none) ///
    mlabels(none) ///
    collabels(none) ///
    posthead(\hline) ///
    cells(b(star fmt(%9.3f)) se(par)) ///
    varlabels(_cons Constant) ///
    prefoot(\\\hline) ///
    stats(N, fmt(%9.0f) labels("N")) ///
    postfoot("\\\hline\hline" ///
            "\multicolumn{10}{p{0.9\textwidth}}{\footnotesize Significance levels * 10\% ** 5\% *** 1\%. Notes: The table presents" ///
    " the results of multi-level multinomial logistic regression models with random effects" ///
    " nested at the Sample, Village, and Household levels. Base outcome is not seeking help for a reported dispute.} \\" ///
            "\end{longtable}" ///
            "\normalsize") ///
    nolegend ///
    label ///
    nobaselevels interaction(" $\times$ ") starlevels(* 0.10 ** 0.05 *** 0.01)
	
***Table E6 Malawi

					
estout c2, unstack drop(0b.nobody_base:* _cons) replace style(tex) ///
    prehead("\footnotesize" "\setlength{\tabcolsep}{4pt}" "\begin{longtable}{*{10}{l}}" ///
             "\caption{Correlates of Forum Choice in Malawi \label{tab:Malawi}} \\" ///
            "\hline \hline" ///
            "                    & \multicolumn{3}{c}{Malawi} \\ \hline" ///
            "Dependent Variable  &       State   &   Customary   & Other Comm.   \\") ///
    title("") ///
    eqlabels(none) ///
    mlabels(none) ///
    collabels(none) ///
    posthead(\hline) ///
    cells(b(star fmt(%9.3f)) se(par)) ///
    varlabels(_cons Constant) ///
    prefoot(\\\hline) ///
    stats(N, fmt(%9.0f) labels("N")) ///
    postfoot("\\\hline\hline" ///
            "\multicolumn{10}{p{0.9\textwidth}}{\footnotesize Significance levels * 10\% ** 5\% *** 1\%. Notes: The table presents" ///
    " the results of multi-level multinomial logistic regression models with random effects" ///
    " nested at the Sample, Village, and Household levels. Base outcome is not seeking help for a reported dispute.} \\" ///
            "\end{longtable}" ///
            "\normalsize") ///
    nolegend ///
    label ///
    nobaselevels interaction(" $\times$ ") starlevels(* 0.10 ** 0.05 *** 0.01)
	
	
	
***Table E7 Kenya

estout c3, unstack drop(0b.nobody_base:* _cons) replace style(tex) ///
    prehead("\footnotesize" "\setlength{\tabcolsep}{4pt}" "\begin{longtable}{*{10}{l}}" ///
             "\caption{Correlates of Forum Choice in Kenya \label{tab:Kenya}} \\" ///
            "\hline \hline" ///
            "                    & \multicolumn{3}{c}{Kenya} \\ \hline" ///
            "Dependent Variable  &       State   &   Customary   & Other Comm.   \\") ///
    title("") ///
    eqlabels(none) ///
    mlabels(none) ///
    collabels(none) ///
    posthead(\hline) ///
    cells(b(star fmt(%9.3f)) se(par)) ///
    varlabels(_cons Constant) ///
    prefoot(\\\hline) ///
    stats(N, fmt(%9.0f) labels("N")) ///
    postfoot("\\\hline\hline" ///
            "\multicolumn{10}{p{0.9\textwidth}}{\footnotesize Significance levels * 10\% ** 5\% *** 1\%. Notes: The table presents" ///
    " the results of multi-level multinomial logistic regression models with random effects" ///
    " nested at the Sample, Village, and Household levels. Base outcome is not seeking help for a reported dispute.} \\" ///
            "\end{longtable}" ///
            "\normalsize") ///
    nolegend ///
    label ///
    nobaselevels interaction(" $\times$ ") starlevels(* 0.10 ** 0.05 *** 0.01)
	
		
	
**Table E8 	
	
******peri urban v. rural models
	
***M1 Main model, all disputes

gsem (nobody_base <- chiefrelated migrant10   maj_eth  std_Age  education_recode insecurity  Married##Male reported_comm b2.category std_a_cap_time std_village_n_dist ///
prop_migrant ELF   ///
, mlogit ) group (LGPIsample2 sqkm SbjNum) if purban ==1,  nocapslatent 

estimates store p1


gsem (nobody_base <- chiefrelated migrant10   maj_eth  std_Age  education_recode insecurity  Married##Male reported_comm b2.category std_a_cap_time std_village_n_dist ///
prop_migrant ELF   ///
, mlogit ) group (LGPIsample2 sqkm SbjNum) if purban ==0 ,  nocapslatent 

estimates store p2


***Table E8 

estout p1 p2, unstack drop(0b.nobody_base:* _cons) replace style(tex) ///
    prehead("\footnotesize" "\setlength{\tabcolsep}{4pt}" "\begin{longtable}{*{10}{l}}" ///
            "\caption{Correlates of Forum Choice, by Urban/Rural \label{tab:urban forums}} \\" ///
            "\hline \hline" ///
            "                    & \multicolumn{3}{c}{Peri-urban} & \multicolumn{3}{c}{Rural} \\ \hline" ///
            "Dependent Variable  &       State   &   Customary   & Other Comm.   &       State   &   Customary   & Other Comm.   \\") ///
    title("") ///
    eqlabels(none) ///
    mlabels(none) ///
    collabels(none) ///
    posthead(\hline) ///
    cells(b(star fmt(%9.3f)) se(par)) ///
    varlabels(_cons Constant) ///
    prefoot(\\\hline) ///
    stats(N, fmt(%9.0f) ///
          labels("N")) ///
postfoot("\\\hline\hline" ///
            "\multicolumn{10}{p{0.9\textwidth}}{\footnotesize Significance levels * 10\% ** 5\% *** 1\%. Notes:	The table presents" ///
   " the results of multi-level multinomial logistic regression models with random effects" ///
    " nested at the Sample, Village, and Household levels. Base outcome is not seeking help for a reported dispute.} \\" ///
            "\end{longtable}" ///
            "\normalsize") ///
    nolegend ///
    label ///
    nobaselevels interaction(" $\times$ ") starlevels(* 0.10 ** 0.05 *** 0.01)	
	
	
	
*------------------------------------------------------------------------------
*Robustness check multinomial model with no dispute as base 
*------------------------------------------------------------------------------
***Table E9 forum measure is first dispute observation per household
	
gsem (dispute_forum <- chiefrelated migrant10   maj_eth  std_Age  education_recode insecurity  Married##Male reported_comm std_a_cap_time std_village_n_dist ///
prop_migrant ELF    ///
, mlogit ) group (LGPIsample2 sqkm) if additional_obs==0,  nocapslatent 

estimates store r1

estout r1, unstack drop(0b.dispute_forum:* 1.dispute_forum:* *cons _cons) replace style(tex) ///
    prehead("\footnotesize" "\setlength{\tabcolsep}{4pt}" "\begin{longtable}{*{10}{l}}" ///
            "\caption{Multinomial Forum Choice Model with No Dispute as Base \label{tab:no_dispute}} \\" ///
            "\hline \hline" ///
            "                    & \multicolumn{3}{c}{Pooled} \\ \hline" ///
            "Dependent Variable  &       State   &   Customary   & Other Comm.   \\") ///
    title("") ///
    eqlabels(none) ///
    mlabels(none) ///
    collabels(none) ///
    posthead(\hline) ///
    cells(b(star fmt(%9.3f)) se(par)) ///
    varlabels(_cons Constant) ///
    prefoot(\\\hline) ///
    stats(N, fmt(%9.0f) labels("N")) ///
    postfoot("\\\hline\hline" ///
            "\multicolumn{10}{p{0.9\textwidth}}{\footnotesize Significance levels * 10\% ** 5\% *** 1\%. Notes: The table presents" ///
    " the results of multi-level multinomial logistic regression models with random effects" ///
    " nested at the Sample, Village, and Household levels. Outcomes are No Dispute, No Forum Use, Dispute/State Forum, Dispute/Customary" ///
	" Forum, Dispute/Community. Base is No Dispute. } \\" ///
            "\end{longtable}" ///
            "\normalsize") ///
    nolegend ///
    label ///
    nobaselevels interaction(" $\times$ ") starlevels(* 0.10 ** 0.05 *** 0.01)

*------------------------------------------------------------------------------
*Resolved Conflicts and Satisfaction data  
*------------------------------------------------------------------------------

***descriptives in the paper

ttest Resolved, by (State_notCA)
ttest Able, by (State_notCA)
ttest Willing, by (State_notCA)
ttest Obligated, by (State_notCA)
ttest Onlyoption, by (State_notCA)

***Table E10 


melogit Resolved State_actor_D2 chiefrelated migrant10   maj_eth  std_Age education_recode insecurity i.Mar_gen reported_comm  b2.category std_A_dist  std_village_n_dist ///
prop_migrant ELF || LGPIsample2:  || sqkm: || SbjNum:  
estimates store s1, title (Resolved M1)

melogit Resolved i.State_actor_D2##b2.category chiefrelated migrant10   maj_eth  std_Age education_recode insecurity i.Mar_gen reported_comm   std_A_dist  std_village_n_dist ///
prop_migrant ELF || LGPIsample2:  || sqkm: || SbjNum:  
estimates store s2, title (Resolved M2)


estout s1 s2, replace style(tex) ///
    prehead("\footnotesize" "\setlength{\tabcolsep}{4pt}" "\begin{longtable}{*{10}{l}}" ///
            "\caption{Resolved Conflicts Among Those Using Forums \label{tab:resolved_conflicts}} \\" ///
            "\hline \hline" ///
            "                    & \multicolumn{2}{c}{Pooled Disputes} \\ \hline" ///
            "Dependent Variable  &       Model 1   &   Model 2   \\") ///
    title("") ///
    eqlabels(none) ///
    mlabels(none) ///
    collabels(none) ///
    posthead(\hline) ///
    cells(b(star fmt(%9.3f)) se(par)) ///
    varlabels(_cons Constant ///
        "var(_cons[LGPIsample2])" "var(Sample)" ///
        "var(_cons[LGPIsample2>sqkm])" "var(Village)" ///
        "var(_cons[LGPIsample2>sqkm>SbjNum])" "var(Household)") ///
    drop (maj_eth prop_migrant ELF) ///
    prefoot(\\\hline) ///
    stats(chi2 N, fmt(%9.2f %9.0f g) labels(chi2)) ///
    postfoot("\\\hline\hline" ///
            "\multicolumn{10}{p{0.9\textwidth}}{\footnotesize Significance levels * 10\% ** 5\% *** 1\%. Notes: The table presents" ///
    " the results of multi-level logistic regression models with random effects. " ///
    " nested at the Sample, Village, and Household levels.} \\" ///
            "\end{longtable}" ///
            "\normalsize") ///
    nolegend ///
    label ///
    nobaselevels interaction(" $\times$ ") starlevels(* 0.10 ** 0.05 *** 0.01)
	


